/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Background;

import Core.Status;
import Core.Vector2;
import Thing.Thing;
import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author THINH
 */
public class Ground extends Background{
    
    public Ground(){
        againstVec = Vector2.Zero();
        
    
    }
    //main func
    public void CollisionWith(Thing thing){
        
        if(thing.getVelocity().y>=0){
            thing.setVelocity(new Vector2(thing.getVelocity().x,0));            
            thing.setPos(thing.getPos().x ,thing.getPos().y-1);
        }
        
        if(thing.getVelocity().y<0){
            thing.setVelocity(new Vector2(thing.getVelocity().x,0));            
            thing.setPos(thing.getPos().x ,thing.getPos().y+20);
        }
         /*
         if(status.value == Status.GoLeft){
            thing.setVelocity(new Vector2(thing.getVelocity().x-1,thing.getVelocity().y));
         }
         if(status.value == Status.GoRight){
            thing.setVelocity(new Vector2(thing.getVelocity().x+1,thing.getVelocity().y));
         }*/
         super.CollisionWith(thing);
    }
    
    
}
